package com.ycsj.goldmedalnewconcept.teacher.adapter;

import android.content.Context;
import android.text.TextUtils;
import android.widget.TextView;

import com.ycsj.common.base.CommonAdapter;
import com.ycsj.common.base.ViewHolder;
import com.ycsj.goldmedalnewconcept.R;
import com.ycsj.goldmedalnewconcept.teacher.bean.InputWordInfo;

import java.util.List;

/**
 * 用单词的正确形式填空的列表适配器
 * Created by Administrator on 2018/9/4 0004.
 */

public class RvWordFormAdapter extends CommonAdapter<InputWordInfo> {
    public RvWordFormAdapter(Context context, List<InputWordInfo> datas, int layoutId) {
        super(context, datas, layoutId);
    }

    @Override
    public void convert(ViewHolder holder, InputWordInfo inputWordInfo) {

        //设置标号
        TextView tvIndex = holder.getView(R.id.tv_index);
        tvIndex.setText(inputWordInfo.flag+".");

        //输入的内容,默认为空
        TextView tvContent = holder.getView(R.id.tv_content);
        if (!TextUtils.isEmpty(inputWordInfo.word)) {
            tvContent.setText(inputWordInfo.word);
        } else {
            tvContent.setText("");
        }
    }
}
